package com.jianxin.citycardcustomermanager;

import android.view.WindowManager;

import com.lcy.estate.base.SimpleActivity;
import com.lcy.estate.module.main.activity.EstateMainActivity;

import java.util.concurrent.TimeUnit;

import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;

public class MainActivity extends SimpleActivity {

    private static final int DELAY_SECONDS = 2;

    @Override
    protected void initWindowFlags() {
        showDarkStatus = true;
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS);
    }

    @Override
    protected int getLayout() {
        return R.layout.activity_main;
    }

    @Override
    protected void initEventAndData() {
        addSubscribe(Observable.timer(DELAY_SECONDS, TimeUnit.SECONDS)
                .observeOn(AndroidSchedulers.mainThread())
                .compose(this.<Long>bindToLifecycle())
                .subscribe(new Consumer<Long>() {
                    @Override
                    public void accept(Long aLong) {
                        //  TODO 传入memberId
                        EstateMainActivity.start(MainActivity.this, "2");
                        finish();
                    }
                }));
    }

    @Override
    protected void initListeners() {

    }


}
